<template>
  <div class="Showcase4">
    <div class="shadow-box">
      <div class="shadow-box-top">
        <img class="shadow-box-top-left" :src="publicUrls + 'free/style8/Showcase4dy1.webp'" alt="" />
        <div
          class="shadow-box-top-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style8/Showcase4dy2.webp'})`,
          }"
        ></div>
        <img class="shadow-box-top-right" :src="publicUrls + 'free/style8/Showcase4dy3.webp'" alt="" />
      </div>
      <div class="shadow-box-center">
        <div
          class="shadow-box-center-left"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style8/Showcase4dy4.webp'})`,
          }"
        ></div>
        <div class="shadow-box-center-center"></div>
        <div
          class="shadow-box-center-right"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style8/Showcase4dy6.webp'})`,
          }"
        ></div>
      </div>
      <div class="shadow-box-bottom">
        <img class="shadow-box-bottom-left" :src="publicUrls + 'free/style8/Showcase4dy7.webp'" alt="" />
        <div
          class="shadow-box-bottom-center"
          :style="{
            backgroundImage: `url(${publicUrls + 'free/style8/Showcase4dy8.webp'})`,
          }"
        ></div>
        <img class="shadow-box-bottom-right" :src="publicUrls + 'free/style8/Showcase4dy9.webp'" alt="" />
      </div>
    </div>
    <div class="Showcase4-top">
      <div
        :style="{
          left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(index), item.width, 1.1944)}rem`,
        }"
        class="ex-item"
        v-for="(item, index) in props.list"
        :key="index"
      >
        <div class="name-box" :style="{ backgroundImage: `url(${publicUrls + 'free/style8/Showcase4bg10.webp'})` }">
          <div class="name-item">{{ item.name }}</div>
        </div>
      </div>

      <img class="Showcase4-top-left" :src="publicUrls + 'free/style8/Showcase4bg1.webp'" alt="" />
      <div
        class="Showcase4-top-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase4bg2.webp'})`,
        }"
      ></div>
      <img class="Showcase4-top-right" :src="publicUrls + 'free/style8/Showcase4bg3.webp'" alt="" />
    </div>
    <div class="Showcase4-center">
      <div
        class="Showcase4-center-left"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase4bg4.webp'})`,
        }"
      ></div>
      <div class="Showcase4-center-center"></div>
      <div
        class="Showcase4-center-right"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase4bg6.webp'})`,
        }"
      ></div>
    </div>
    <div class="Showcase4-bottom">
      <img class="Showcase4-bottom-left" :src="publicUrls + 'free/style8/Showcase4bg7.webp'" alt="" />
      <div
        class="Showcase4-bottom-center"
        :style="{
          backgroundImage: `url(${publicUrls + 'free/style8/Showcase4bg8.webp'})`,
        }"
      ></div>
      <img class="Showcase4-bottom-right" :src="publicUrls + 'free/style8/Showcase4bg9.webp'" alt="" />
    </div>
    <!-- Showcase4Topleft -->
  </div>
</template>   

<script lang="ts">
export default defineComponent({
  name: 'style1',
});
</script>
  
<script setup lang="ts">
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
const props = defineProps({
  list: {
    type: Object,
  },
});
// 1.30
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }

  return x + 0.3;
};
</script>   

<style scoped lang="less">
.Showcase4 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 484px;
  min-width: 339px;
  // -webkit-box-reflect: below 0% linear-gradient(transparent, rgba(0, 0, 0, 0.2));
}
.Showcase4-top {
  position: relative;
  display: flex;
  width: 100%;
  height: 231px;
}
.Showcase4-top-left {
  width: 63px;
  height: 231px;
}
.Showcase4-top-center {
  flex: 1;
  height: 231px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase4-top-right {
  width: 63px;
  height: 231px;
}
.Showcase4-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 267px);
}
.ex-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  top: 159px;
  width: 172px;
  height: 41px;
  z-index: 10;
}
.name-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 172px;
  height: 41px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  .name-item {
    width: 145px;
    height: 28px;
    font-family: 'SourceHanSerifCN-Bold';
    font-size: 18px;
    line-height: 28px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    color: rgba(255, 255, 255, 1);
  }
}

.Showcase4-center-left {
  width: 63px;
  height: 100%;
  background-size: 63px 100%;
  background-repeat: repeat;
}
.Showcase4-center-center {
  position: relative;
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: auto 100%;
}
.Showcase4-center-right {
  width: 63px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase4-bottom {
  display: flex;
  width: 100%;
  height: 36px;
}
.Showcase4-bottom-left {
  width: 63px;
  height: 36px;
}
.Showcase4-bottom-center {
  flex: 1;
  height: 36px; 
  background-repeat: repeat;
  background-size: 100% 100%;
}
.Showcase4-bottom-right {
  width: 63px;
  height: 36px;
}
.shadow-box {
  display: flex;
  flex-direction: column;
  position: absolute;
  bottom: calc(-100% + 34px);
  left: 0;
  z-index: -1;

  width: 100%;
  height: calc(100%);

  opacity: 0.2;
}
.shadow-box-top {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  height: 65px;
}
.shadow-box-top-left {
  width: 63px;
  height: 65px;
}
.shadow-box-top-center {
  flex: 1;
  height: 63px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-box-top-right {
  width: 63px;
  height: 65px;
}
.shadow-box-center {
  position: relative;
  display: flex;
  width: 100%;
  height: calc(100% - 296px);
}
.shadow-box-center-left {
  width: 63px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-box-center-center {
  flex: 1;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-box-center-right {
  width: 63px;
  height: 100%;
  background-repeat: repeat;
  background-size: 100% auto;
}
.shadow-box-bottom {
  position: relative;
  display: flex;
  width: 100%;
  height: 231px;
}
.shadow-box-bottom-left {
  width: 63px;
  height: 231px;
}
.shadow-box-bottom-center {
  flex: 1;
  height: 231px;
  background-repeat: repeat;
  background-size: 100% 100%;
}
.shadow-box-bottom-right {
  width: 63px;
  height: 231px;
}
</style>